/*
 * @(#)OrderApplication.java 2021年3月8日
 *
 * Copyright (c) 2010 by rayootech.com. All rights reserved.
 */
package com.nuctech;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * 订单微服务主入口
 *
 * @author lilu
 * @date 2021年3月8日
 * @since 1.0.0
 */
@EnableFeignClients // 开启Feign
@EnableDiscoveryClient // Nacos服务注册
@SpringBootApplication
public class OrderApplication {

	public static void main(String[] args) {
		SpringApplication.run(OrderApplication.class, args);
	}

	/**
	 * 微服务远程调用模板实例对象
	 * 使用Ribbon实现微服务多个实例负载均衡
	 *
	 * @author lilu
	 * @date 2021/3/9 8:55 上午
	 * @since 1.0.0
	 *
	 * @return org.springframework.web.client.RestTemplate
	 * @throws
	 */
	@Bean
	@LoadBalanced
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}

}
